﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.IO;

namespace RSS_Downloader
{
    class DownloadTask
    {
        private MediaFile mediaFile;
        public MediaFile MediaFile
        {
            get { return mediaFile; }
        }

        private long length;
        public long Length
        {
            get { return length; }
        }


        public DownloadTask(MediaFile mediaFile)
        {
            this.mediaFile = mediaFile;
        }

        ~DownloadTask()
        {
            
        }

        public void Initialize()
        {
            HttpWebRequest request = WebRequest.Create(mediaFile.Uri) as HttpWebRequest;

            if (request.HaveResponse)
            {
                length = Convert.ToInt64(request.Headers[HttpResponseHeader.ContentLength]);
            }
        }
    }
}
